/**
 * author XGP
 * date: 2018/08/12
 * des: 表单验证规则
 */

/**
 * 添加员工 form表单验证
 */
export const addRosterFormRules = {
  employeeNo: [
    { required: true, message: '必填项', trigger: 'blur' },
    { min: 3, max: 20, message: '长度在 3 到 20个字符', trigger: 'blur' },
    { pattern: /^[0-9]+$/, message: '输入字符只能为数字', trigger: 'blur' }
  ],
  employeeName: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  idType: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  idNo: [
    { required: true, message: '必填项', trigger: 'blur' },
    { pattern: /[0-9A-Za-z_]+/, message: '输入字符只能为数字、字母或者下划线', trigger: 'blur' }
  ],
  sex: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  employeeStatus: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  orgId: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  position: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  postLevel: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  constractCompany: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  workNature: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  entryDate: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  conrrectionDate: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  workAddree: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  targetOrgId: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  targetPost: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  targetPostLevel: [
    { required: true, message: '必填项', trigger: 'blur' },
  ]
}

/**
 * 人事异动 form表单验证
 */
export const turnoverFormRules = {
  turnoverType: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  turnoverCause: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  targetOrgId: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  targetPost: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  targetPostLevel: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  targetWorkAddr: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  targetCompany: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  effectDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}

/**
 * 办理入职 form表单验证
 */
export const dealOnJobFormRules = {
  employeeNo: [
    { required: true, message: '必填项', trigger: 'blur' },
    { min: 3, max: 20, message: '长度在 3 到 20个字符', trigger: 'blur' },
    { pattern: /^[0-9]+$/, message: '输入字符只能为数字', trigger: 'blur' }
  ],
  employeeName: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  idType: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  idNo: [
    { required: true, message: '必填项', trigger: 'blur' },
    { pattern: /[0-9A-Za-z_]+/, message: '输入字符只能为数字、字母或者下划线', trigger: 'blur' }
  ],
  sex: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  employeeStatus: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  orgId: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  position: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  postLevel: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  constractCompany: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  workNature: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  entryDate: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  conrrectionDate: [
    { required: true, message: '必填项', trigger: 'blur' },
  ],
  workAddree: [
    { required: true, message: '必填项', trigger: 'blur' },
  ]
}

/**
 * 放弃入职 form表单验证
 */
export const abandonJobFormRules = {
  remarks: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}

/**
 * 试用延期 form表单验证
 */
export const extendProbationRules = {
  employeeNo: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  delayApplyDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  planCorrectionDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  delayCorrectionDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  delayReason: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}

/**
 * 办理离职 form表单验证
 */
export const dealQuitFormRules = {
  employeeNo: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  leaveApplyDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  lastWorkDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  isSalarySettled: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  salarySettledDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  leaveReason: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}

/**
 * 确认离职 form表单验证
 */
export const confirmQuitFormRules = {
  leaveApplyDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  lastWorkDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  isSalarySettled: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  salarySettledDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  leaveReason: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}

/**
 * 调整离职信息 form表单验证
 */
export const adjustQuitFormRules = {
  employeeNo: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  leaveApplyDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  isSalarySettled: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  lastWorkDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  salarySettledDate: [
    { required: true, message: '必填项', trigger: 'blur' }
  ],
  leaveReason: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}


/**
 * 调整离职信息 form表单验证
 */
export const revokeQuitFormRules = {
  employeeStatus: [
    { required: true, message: '必填项', trigger: 'blur' }
  ]
}
